package com.twitterbuzz.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class AuthScreen extends Composite{	
	private VerticalPanel mainPanel;	
	private Label appName;
	private Label welcomeMsg;
	private Hyperlink linkUrl;
	private TextBox pin;
	private Label pinLabel;
	private Button continueButton;
	
	public AuthScreen(String url) {
		mainPanel = new VerticalPanel();
		appName = new Label("Visual tweet buzzer");
		appName.setStyleName("newtitle");
		mainPanel.add(appName);
		linkUrl = new Hyperlink("Authentication url", url);
		welcomeMsg = new Label("Just one more step! Open the following URL and grant access to your twitter account");
		welcomeMsg.setStyleName("label");
		mainPanel.add(welcomeMsg);
		mainPanel.add(linkUrl);		
		pinLabel = new Label("Enter the pin");
		pinLabel.addStyleName("label");
		pin = new TextBox();		
		mainPanel.add(pinLabel);
		mainPanel.add(pin);
		continueButton = new Button();
		continueButton = new Button("Continue");	
		continueButton.setStyleName("longbutton");
		mainPanel.add(continueButton);
		
		continueButton.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				//checkLogin(continue.getText(), signInPassword.getText());
			}
		});
		
		initWidget(mainPanel);
	}

}
